<html>
<head><meta charset="utf-8"><title>Implementing `uncommon_codepoints` lint · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html">Implementing `uncommon_codepoints` lint</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184629251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184629251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184629251">(Jan 02 2020 at 05:31)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> I want to have a try implementing the <code>uncommon_codepoints</code> lint. But I'm not sure where is the appropriate position to implement this checking. I think implementing it on lexer will cause a lot of repetitive checking, and want to avoid it if possible.</p>



<a name="184629256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184629256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184629256">(Jan 02 2020 at 05:31)</a>:</h4>
<p><a href="https://github.com/rust-lang/rfcs/blob/master/text/2457-non-ascii-idents.md#exotic-codepoint-detection" target="_blank" title="https://github.com/rust-lang/rfcs/blob/master/text/2457-non-ascii-idents.md#exotic-codepoint-detection">https://github.com/rust-lang/rfcs/blob/master/text/2457-non-ascii-idents.md#exotic-codepoint-detection</a><br>
<a href="https://github.com/rust-lang/rust/issues/55467" target="_blank" title="https://github.com/rust-lang/rust/issues/55467">https://github.com/rust-lang/rust/issues/55467</a></p>



<a name="184639830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184639830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184639830">(Jan 02 2020 at 10:03)</a>:</h4>
<blockquote>
<p>I think implementing it on lexer will cause a lot of repetitive checking</p>
</blockquote>
<p>Why? Lexer doesn't do its work repeatedly.</p>



<a name="184639922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184639922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184639922">(Jan 02 2020 at 10:04)</a>:</h4>
<p>Lexer (or proc macro server) creates a token once, then it can be cloned, passed, etc. without any lexer participation.</p>



<a name="184643393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184643393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184643393">(Jan 02 2020 at 11:04)</a>:</h4>
<p>I thought this will cause repetitive checking on different usages of the same identifier? Or should i cache the <code>Symbol</code> value somehow?</p>



<a name="184643806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184643806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184643806">(Jan 02 2020 at 11:13)</a>:</h4>
<p>I searched around and didn't find any lint-related code around in the lexer...  Am i the first one adding a lint there?  What should i do to make use of the lint infrastructure described in  <a href="https://rust-lang.github.io/rustc-guide/diagnostics.html#lints" target="_blank" title="https://rust-lang.github.io/rustc-guide/diagnostics.html#lints">https://rust-lang.github.io/rustc-guide/diagnostics.html#lints</a> ?</p>



<a name="184644553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184644553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184644553">(Jan 02 2020 at 11:28)</a>:</h4>
<p>Maybe i should insert my implementation into <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_lint/non_ascii_idents.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_lint/non_ascii_idents.rs">https://github.com/rust-lang/rust/blob/master/src/librustc_lint/non_ascii_idents.rs</a> ? Seems much easier...</p>



<a name="184661961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184661961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184661961">(Jan 02 2020 at 16:08)</a>:</h4>
<p>I started looking at this a couple of weeks back, I can help you with the implementation</p>



<a name="184661980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Implementing%20%60uncommon_codepoints%60%20lint/near/184661980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Implementing.20.60uncommon_codepoints.60.20lint.html#184661980">(Jan 02 2020 at 16:08)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/67810" target="_blank" title="https://github.com/rust-lang/rust/pull/67810">https://github.com/rust-lang/rust/pull/67810</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>